/**
 * 
 */
package atack.tesis.kelluntekun.ui.componentes.utils;

import com.vaadin.terminal.ThemeResource;
import com.vaadin.ui.Label;
import com.vaadin.ui.Window.Notification;

/**
 * @author marza
 *
 */
public class UiUtils {
	
	/**
	 * Retorna un Label vacío del ancho y alto recibido. Util para separar
	 * elementos en un layout
	 * 
	 * @param width
	 * 			String con el ancho ej: "20px"
	 * @param height
	 * 			String con el Alto ej: "10px"
	 * @return label con las dimensiones especificadas.
	 */
	public static Label getLbSpace(String width, String height){
		Label label = new Label();
		label.setWidth(width);
		label.setHeight(height);
		return label;
	}
	
	public static Notification getWarningNotification(String msg, String subMsg){
		
		Notification n = new Notification("<center>"+msg+"</center>",Notification.TYPE_WARNING_MESSAGE);
		n.setDelayMsec(6000);
		n.setHtmlContentAllowed(true);
		n.setDescription("<br>"+subMsg);
		n.setPosition(Notification.POSITION_CENTERED_TOP);
//		n.setIcon(new ThemeResource("../runo/icons/32/attention.png"));
		return n;
	}
	
	public static Notification getTrayNotification(String msg){
		Notification n = new Notification("<center>"+msg+"</center>", Notification.TYPE_TRAY_NOTIFICATION);
		n.setDelayMsec(6000);
		n.setHtmlContentAllowed(true);
		n.setIcon(new ThemeResource("../runo/icons/16/ok.png"));
		return n;
		
		
	}
}
